<link rel="StyleSheet" href="__PUBLIC__/Js/dtree/dtree.css" type="text/css" />
<script type="text/javascript" src="__PUBLIC__/Js/dtree/dtree.js"></script>
<script type="text/javascript">     
   tree = new dTree('tree');//创建一个对象.
   <php>if(!empty($_REQUEST['onclick'])){</php>tree.addOnclickJs(function(rel,txt){<php>echo $_REQUEST['onclick']."(rel,txt)";</php>;});<php>}</php>
   code = "{$_GET['code']}";   
   $.ajax({      
		    url:"{:U('Index://Public/getDictXML',array('code'=>$_GET['code']))}",      
		    type:'get', //数据发送方式      
		    //dataType:'xml', //接受数据格式      
		    error:function(json){     
		             alert( "not lived!");     
		       },     
		    async: false ,//同步方式     
		    success: function(txt){  

		    		var objs	=	eval('(' + txt + ')');
		    		
		    		for(i=0;i<objs.length;i++){
		    				//alert(objs[i].id+objs[i].pid+objs[i].code+"  "+code);
		    				if(objs[i].code==code){
		    						//tree.add(objs[i].id,-1,objs[i].desc,objs[i].code,'','','',''); 
		    						tree.add(objs[i].id,-1,objs[i].desc,'','','','',''); 
		    				}else{
			    					//tree.add(objs[i].id,objs[i].pid,objs[i].desc,objs[i].code,'','','',''); 
			    					tree.add(objs[i].id,objs[i].pid,objs[i].desc,objs[i].code,'','',objs[i].code,'',''); 
			    			}
		    		}
		    }     
  	});      
    $('#dict_tree').html(tree.gethtml());
</script>  
<div class="dtree" style="float:left;margin-left:10px;text-align: left;width:200px">
	<p><a href="javascript: tree.openAll();">全部打开</a> | <a href="javascript: tree.closeAll();">全部关闭</a> | <a href="javascript: <php>if(!empty($_REQUEST['onclick'])){ echo $_REQUEST['onclick']."('','');";}else{ </php>_tmp_setselectdict('','');<php>}</php>ui.box.close();">清空选项</a></p>
	<div id="dict_tree" style="float:left;text-align: left;margin-bottom:10px;">
	</div>
</div>

